unit UfrmStockManager;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, RzPanel, DBGridEhGrouping, DB, ADODB, GridsEh,
  DBGridEh, RzButton, ActnList,EhLibADO;

type
  TfrmStockManager = class(TForm)
    DBGridEh1: TDBGridEh;
    qryStockView: TADOQuery;
    dsStockView: TDataSource;
    RzToolbar1: TRzToolbar;
    RzToolButton1: TRzToolButton;
    RzToolButton3: TRzToolButton;
    RzToolButton4: TRzToolButton;
    RzToolButton5: TRzToolButton;
    actlst1: TActionList;
    act1: TAction;
    act2: TAction;
    act3: TAction;
    act4: TAction;
    RzStatusBar1: TRzStatusBar;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure act1Execute(Sender: TObject);
    procedure act2Execute(Sender: TObject);
    procedure act3Execute(Sender: TObject);
    procedure act4Execute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmStockManager: TfrmStockManager;

implementation

uses UdataModel,UfrmInvoiceEdit;

{$R *.dfm}

procedure TfrmStockManager.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action:=caFree;
end;

procedure TfrmStockManager.FormShow(Sender: TObject);
begin
   qryStockView.Active:=true;
end;

procedure TfrmStockManager.act1Execute(Sender: TObject);
begin
  with TfrmInvoiceEdit.Create(Application) do
    begin
      Enter;
    end;
    RzToolButton5.Click;
end;

procedure TfrmStockManager.act2Execute(Sender: TObject);
begin
  with TfrmInvoiceEdit.Create(Application) do
  begin
     Edit(qryStockView.fieldbyname('id').Value);
  end;
   RzToolButton5.Click;
end;

procedure TfrmStockManager.act3Execute(Sender: TObject);
begin
   qryStockView.Active:=False;
   qryStockView.Active:=True;
end;

procedure TfrmStockManager.act4Execute(Sender: TObject);
begin
  close;
end;

end.
